<html>

<head>
<title>Classes: ColorPicker</title>
<style type="text/css"><!--tt { font-size: 10pt } pre { font-size: 10pt }--></style>
</head>

<body bgcolor="#ffffff" text="#000000" link="#000080" vlink="#800000" alink="#0000ff">

<table border="0" cellpadding="0" cellspacing="0" bgcolor="#d0d0d0">
  <tr>
    <td width="120" align="left"><a href="channel.html"><img width="96" height="20" border="0"
    src="../images/navlt.gif" alt="ChannelHandler"></a></td>
    <td width="96" align="left"><a href="cs.html"><img width="64" height="20" border="0"
    src="../images/navrt.gif" alt="CommandSequence"></a></td>
    <td width="96" align="left"><a href="../classes.html"><img width="56" height="20"
    border="0" src="../images/navup.gif" alt="Classes"></a></td>
    <td width="288" align="right"><a href="../index.html"><img width="230" height="20"
    border="0" src="../images/proglw.gif" alt="Table of Contents"></a></td>
  </tr>
</table>

<table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="600"><br>
    <h3>ColorPicker</h3>
    <p><small><strong>Availability</strong>&nbsp; LightWave&reg; 6.0</small><br>
    <small><strong>Component</strong>&nbsp; Layout, Modeler</small><br>
    <small><strong>Header</strong>&nbsp; <a href="../../include/lwdialog.h">lwdialog.h</a></small></p>
    <p>Color pickers prompt the user for a color selection. They replace the operating
    system's default color selection mechanism, or provide one if no default exists.</p>
    <p>See the <a href="../globals/colorpik.html">Color Picker</a> global for a discussion of
    color pick requests from the host's point of view.</p>
    <p><strong>Activation Function</strong></p>
    <pre>   XCALL_( int ) MyColorPick( long version, GlobalFunc *global,
      LWColorPickLocal *local, void *serverData );</pre>
    <p>The <tt>local</tt> argument to a color picker's activation function is an
    LWColorPickLocal.</p>
    <pre>   typedef void LWHotColorFunc( void *data, float r, float g, float b );

   typedef struct st_LWColorPickLocal {
      int             <strong>result</strong>;
      const char     *<strong>title</strong>;
      float           <strong>red</strong>, <strong>green</strong>, <strong>blue</strong>;
      void           *<strong>data</strong>;
      LWHotColorFunc *<strong>hotFunc</strong>;
   } LWColorPickLocal;</pre>
    <dl>
      <dt><strong><tt>result</tt></strong></dt>
      <dd>The result of the request. Set this to 1 if the user selects a color, 0 if the user
        cancels the request, and a negative number to indicate an error.</dd>
      <dt><tt><br>
        <strong>title</strong></tt></dt>
      <dd>The title string. This is generally displayed near the top of the color dialog and tells
        the user the context of the color request.</dd>
      <dt><tt><br>
        <strong>red</strong>, <strong>green</strong>, <strong>blue</strong></tt></dt>
      <dd>The initial color. If the user selects a color, the selected color should be written in
        these fields. The nominal range for RGB levels is 0.0 to 1.0, but they can be outside this
        range.</dd>
      <dt><tt><br>
        <strong>data</strong></tt></dt>
      <dd>A pointer to data that should be passed to the caller's color callback.</dd>
      <dt><tt><br>
        <strong>hotFunc</strong>( data, r, g, b )</tt></dt>
      <dd>A color callback supplied by the host. Call this while the user is playing with any of
        your color selection mechanisms. This allows the host to update its display interactively
        as the user selects a color. (The &quot;hot&quot; part of the name refers to this dynamic
        interaction. This isn't a video color gamut test.)</dd>
    </dl>
    <p><strong>Example</strong></p>
    <p>The <a href="../../sample/Layout/Generic/simpcolr/">simpcolr</a> SDK sample is a simple example of a
    color picker. </td>
  </tr>
</table>
</body>
</html>
